import os 
import sys
BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, BASE)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from fbprophet import Prophet
from  commonLib  import module01  as myfb
#网易UU加速器旗舰店 
businessId="2202008043422"
root_path="./py01/PythonApp01/data/"
#data_file=f"{businessId}-2023.csv"
forecast_file=f"{businessId}_20240506_forecast.csv"
fact_file=f"{businessId}_20240506_fact.csv"
image_file=f"{businessId}_20240506_compare.png"
image_fb_file=f"{businessId}_20240304_fb.png"

#data_file_path= os.path.join(root_path,data_file)
forecast_file_path= os.path.join(root_path,forecast_file)
fact_file_path= os.path.join(root_path,fact_file)
image_file_path= os.path.join(root_path,image_file)
image_fb_file_path= os.path.join(root_path,image_fb_file)

# 创建一个空的列表用来存储所有文件的数据
all_data = []

#读取数据
#2022年数据
data=myfb.read_data(os.path.join(root_path,f'{businessId}-2022.csv'))
all_data.append(data)

#2023年数据
data=myfb.read_data(os.path.join(root_path,f'{businessId}-2023.csv'))
all_data.append(data)

#2024年数据
data=myfb.read_data(os.path.join(root_path,f'{businessId}-2024_0104.csv'))
all_data.append(data)

myfb.fb_prophet_draw(all_data,fact_file_path,forecast_file_path,image_file_path,businessId=businessId,fbImg_file_path=image_fb_file_path)


